<template>
  <div class="board-config-scale">
    <span class="board-config-scale__label">缩放比例</span>
    <el-slider v-model="currentZoom" :min="0" :max="1" :step="0.01" style="width:300px" @change="e=>change(e)" />
  </div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
  name: 'MainBottom',
  data() {
    return {
      currentZoom: 1
    }
  },
  computed: {
  },
  mounted() {
    this.currentZoom = this.$store.state.screen.editorZoom
  },
  methods: {
    change(zoomValue) {
      this._updateEditorZoom(zoomValue)
    },
    formatTooltip(val) {
      return val / 100
    },
    ...mapMutations({
      _updateEditorZoom: 'screen/_updateEditorZoom'
    })
  }
}
</script>
<style scoped>
.board-config-scale {
  position: absolute;
  bottom: 0;
  height: 48px;
  left: 84px;
  z-index: 10001;
  background: #2e2e2e;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.board-config-scale .board-config-scale__label {
  font-size: 12px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  margin-left: 8px;
  padding: 0 10px;
}
</style>
